<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.org/thymeleaf/shiro">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>Title</title>
    <link rel="stylesheet" href="/resources/layui/css/layui.css">
</head>
<body>
<script src="/resources/layui/layui.js"></script>

<script th:inline="none">
    //一般直接写在一个js文件中
    layui.use(['layer', 'form','table'], function(){
        var layer = layui.layer
            ,form = layui.form
            ,table = layui.table
            ,$=layui.jquery;
        //引入表格，使用表格
        var userTable=table.render({
            elem:'#driverTable',
            height:600,
            url:'/feerecordList',
            page:true,
            limits:[5,10,15,20],
            limit:3,
            cols:[[
                {field:'id',title:'编号',width:80,type:'checkbox'},
                {field: 'vid', title: '车牌号码'},
                {field: 'name', title: '规费名称'},
                {field: 'paytime', title: '支付时间'},
                {field: 'paynum', title: '支付金额'},
                {field: 'fuid', title: '规费单位'},
                {field: 'driverid', title: '经办人'},
                {field: 'information', title: '备注'},
                {field: 'status', title: '状态',templet:function (obj) {
                    return obj.status==1?"在职":"休假";
                }},

                {title: '操作', width:250,templet:'#driverListBar',fixed:"right",align:"center"}
            ]]
        })
    });
</script>

<blockquote class="layui-elem-quote quoteBox">
    <form class="layui-form" action="">
        <div class="layui-inline">
            <input type="text" class="layui-input" id="telephone" placeholder="请输入电话号码">
        </div>
        <div class="layui-inline">
            <input type="text" class="layui-input" id="name" placeholder="请输入姓名">
        </div>

        <div class="layui-inline">
            <button type="button" class="layui-btn searchBtn">
                搜索
            </button>
        </div>
        <div class="layui-inline">
            <shiro:hasPermission name="user:delectall">
                <button type="button" class="layui-btn" id="removePatch">
                    批量删除
                </button>
            </shiro:hasPermission>

        </div>
    </form>
</blockquote>

<table id="driverTable" lay-filter="usersList">
    <!--操作-->
    <script id="driverListBar" type="text/html">
        <shiro:hasPermission name="user:edit">
            <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
        </shiro:hasPermission>

        <shiro:hasPermission name="user:delete">
            <a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="del">删除</a>
        </shiro:hasPermission>

        <shiro:hasPermission name="user:look">
            <a class="layui-btn layui-btn-xs layui-btn-primary" lay-event="look">预览</a>
        </shiro:hasPermission>

        <!--<shiro:hasPermission name="user:grant">-->
            <!--<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="grantRole">分配角色</a>-->
        <!--</shiro:hasPermission>-->
    </script>
</table>

</body>
</html>